#include <string.h>
#include <fstream>
#include <iostream>
using std::cout;
using std::cerr;
using std::endl;
using std::ifstream;
using std::string;

void test0(){
    //创建流对象时就进行了文件的绑定
    //后续操作这个流对象就是操作这个文件
    ifstream ifs("Point.cc");   

    //ifstream中的getline是兼容C的写法
    char buff[100] = {0};
    while(ifs.getline(buff,sizeof(buff))){
        cout << buff << endl;
        memset(buff,0,sizeof(buff));
    }
    ifs.close();
}

void test1(){
    ifstream ifs("Point.cc");   
    string line;
    while(std::getline(ifs,line)){
        cout << line << endl;
    }
    ifs.close();
}


int main(void){
    /* test0(); */
    test1();
    return 0;
}
